package com.epam.rentcar.utils.dbconn;

import java.sql.Connection;
import java.sql.SQLException;

import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;

public class MySQLConnection implements ConnEstablisher {

	@Override
	public Connection getConnection() throws SQLException, NamingException {
		InitialContext initContext = new InitialContext();
		DataSource ds = (DataSource) initContext.lookup("MySQLResource");
		return ds.getConnection();
	}
}
